<template>
    <div>
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item> <i class="el-icon-lx-cascades"></i> 监控系统 </el-breadcrumb-item>
            </el-breadcrumb>
        </div>
      <div >
        <video @click="yulan"></video>
      </div>
      
    </div>
  
  
  
  
</template>
<script>
export default {
  data() {
    return {
      app: [
      
      ],
    
    }
  },
  methods: {
    yulan(){
      let rtspStream = null
      app.post('/open-rtsp-stream', function (req, res) {
        // const { ip } = req.body;
        var ip =' 192.168.1.64 ';
        if(rtspStream){
          rtspStream.stop()
          rtspStream = null
        }
        if(ip){
          const rtsp_url = `rtsp://admin:ape.123456@${ip}:554/Streaming/Channels/001`
          rtspStream = new Stream({
            name: 'sockets',
            streamUrl: rtsp_url,
            wsPort: 9998,
            ffmpegOptions: { // 选项ffmpeg标志
              '-stats': '', // 没有必要值的选项使用空字符串
              '-r': 30, // 具有必需值的选项指定键后面的值<br>　　　　
              '-s':'1920*1080'
            }
          })
          res.send({
            code:200,
            msg:'连接成功'
          })
        }else{
          res.send({
            code:400,
            msg:'连接失败'
          })
        }
      })

    }
  }
}

</script>
<style scoped>
.handle-box {
    margin-bottom: 20px;
}

.handle-select {
    width: 120px;
}

.handle-input {
    width: 300px;
    display: inline-block;
}

.table {
    width: 100%;
    font-size: 14px;
}

.red {
    color: #ff0000;
}

.mr10 {
    margin-right: 10px;
}

.table-td-thumb {
    display: block;
    margin: auto;
    width: 40px;
    height: 40px;
}
</style>
